﻿using System.Reflection;
namespace SiteUnity.Frame.Common.Tools.Class
{
    public class ClassTools
    {
        static public object GetProperty(object item, string property)
        {
            return item.GetType().GetProperty(property).GetValue(item, null);
        }

        static public object GetProperty(object item, PropertyInfo propertyinfo)
        {
            return propertyinfo.GetValue(item, null);
        }

        static public void SetProperty(object item, string property, object value)
        {
            item.GetType().GetProperty(property).SetValue(item, value, null);
        }

        static public void SetProperty(object item, PropertyInfo propertyinfo, object value)
        {
            propertyinfo.SetValue(item, value, null);
        }
    }
}
